package com.qf.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import com.qf.bean.Student;
import com.qf.service.StudentService;

/**
 * 2019/12/3
 * 键盘敲烂，月薪过万
 * 登高必自卑，行远必自迩。
 * 不忘初心：像初学者一样拥有一颗谦虚、开放的心态。
 * 李学峰
 */
@Controller
public class StudentController {
@Autowired
private StudentService studentService;
    @RequestMapping("/getstudents")
    public String getstu
        (@RequestParam(defaultValue = "1") int pageindex, ModelMap map){
    Page<Student> page = studentService.findstudents(pageindex, 3);
    map.addAttribute("stupage",page);
    return "show";
}
}
